<template>
  <view class="picture-box" @click="goToPictureDetails">
    <slot></slot>
  </view>
</template>

<script>
export default {
  props: ["list", "index"],
  data() {
    return {
      subPkgRoot: "/subpkg",
    };
  },
  methods: {
    goToPictureDetails() {
      // 缓存list
      getApp().globalData.album_list = this.list;
      // 跳转到图片详情页面
      uni.navigateTo({
        url: `${this.subPkgRoot}/picture_details/index?index=${this.index}`,
      });
    },
  },
  mounted() {
    // console.log(this.list);
    // console.log(this.index);
  },
};
</script>

<style lang="scss" scoped>
.picture-box {
  //   height: 300rpx;
}
</style>
